#include<iostream>
#include<cmath>
using namespace std;
int main()
{
	double a, p;
	int* array = (int*)malloc(sizeof(int) * 100000);
	int i = 0;
	int n;
	int m = 0;
	cin >> n;
	if (n != 0) {
	for (a = 1; a < 110; a++)
	{
		if (m == 0) 
		{
			for (p = 2; p < 11; p++)
			{
				array[i] = pow(a, p);
				if (n == array[i])
				{
					m++;
					break;
				}
				i++;
			}
		}
		else
		{
			break;
		}
	}
	if (m == 0)
	{
		cout << "NO" << endl;
	}
	else
	{
		cout << "YES" << endl;
	}
}
	else
	{
		return 0;
	}

}